<?php

namespace app\admin\model;

use think\Model;

/**
 * 资金充值提现记录
 * @mixin \think\Model
 */
class UserCashRar extends Model
{   

    protected $json = ['notify'];
    protected $jsonAssoc = true;



    public function userInfo()
    {
        return $this->hasone("user", 'u_id', "u_id");
    }

  
    

    /**
     * 支付状态
     * @param  integer $int [键值]
     * @return [type]       [状态文字]
     */
    public static function getPayFlag($int = 0)
    {
        $res = [
            0  => '未支付',
            1  => '已支付',           
        ];

        return $int > 0 ? $res[$int] : $res;
    }

    public static function getCheckFlag($int = 0)
    {
        $res = [
            0 => '待审核',
            1 => '已审核',
        ];

        return $int > 0 ? $res[$int] : $res;
    }

    public static function getType($int = 0)
    {
        $res = [
            1 => '充值',
            2 => '提现',
        ];

        return $int > 0 ? $res[$int] : $res;
    }
}
